home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 2
/
CU Amiga Magazine's Super CD-ROM 02 (1996)(EMAP Images)(GB)[!][issue 1996-04].iso
/
magazine
/
amiga_e
/
e_v3.2a_extras
/
pdsrc
/
ham8demo.e
< prev
next >
Wrap
Text File
|
1992-09-02
|
2KB
|
77 lines
OPT OSVERSION=37
MODULE 'gadtools','libraries/gadtools','intuition/intuition','exec/nodes',
'intuition/screens','intuition/gadgetclass','graphics/text'
ENUM ER_NONE,ER_NOSCRN,ER_NOWINDOW
DEF wnd=NIL:PTR TO window,
scr=NIL:PTR TO screen
PROC shutdown()
IF wnd THEN CloseWindow(wnd)
IF scr THEN CloseScreen(scr)
ENDPROC
PROC setup()
IF (scr:=OpenScreenTagList(NIL,
[SA_WIDTH,528,SA_HEIGHT,512,SA_DEPTH,8,SA_DISPLAYID,$8804,
NIL,NIL]))=NIL THEN Raise(ER_NOSCRN)
IF (wnd:=OpenWindowTagList(NIL,
[WA_LEFT,0,
WA_TOP,0,
WA_WIDTH,528,
WA_HEIGHT,512,
WA_IDCMP,IDCMP_MOUSEBUTTONS,
WA_FLAGS,WFLG_SIMPLE_REFRESH OR WFLG_NOCAREREFRESH OR
WFLG_ACTIVATE OR WFLG_BORDERLESS,
WA_CUSTOMSCREEN,scr,
NIL]))=NIL THEN Raise(ER_NOWINDOW)
ENDPROC
PROC draw()
DEF r,loop1,loop2,loop3
r:=wnd.rport
FOR loop1:=0 TO 7
FOR loop2:=0 TO 7
SetAPen(r,loop1*8+loop2+64)
Move(r,loop2*66,loop1*64)
Draw(r,loop2*66,loop1*64+63)
FOR loop3:=0 TO 63
SetAPen(r,loop3+128)
Move(r,loop2*66+1,loop1*64+loop3)
Draw(r,loop2*66+1,loop1*64+loop3)
SetAPen(r,loop3+192)
Move(r,loop2*66+2+loop3,loop1*64)
Draw(r,loop2*66+2+loop3,loop1*64+63)
ENDFOR
ENDFOR
ENDFOR
ENDPROC
PROC waitmouse()
DEF mes:PTR TO intuimessage,quit=FALSE
REPEAT
IF mes:=GetMsg(wnd.userport)
IF mes.class=IDCMP_MOUSEBUTTONS THEN quit:=TRUE
ReplyMsg(mes)
ELSE
WaitPort(wnd.userport)
ENDIF
UNTIL quit
ENDPROC
PROC main() HANDLE
DEF erlist:PTR TO LONG
setup()
draw()
waitmouse()
Raise(ER_NONE)
EXCEPT
shutdown()
IF exception>0
erlist:=['open screen','open window']
EasyRequestArgs(0,[20,0,0,'Could not \s.','OK'],0,[erlist[exception-1]])
ENDIF
ENDPROC